VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsCommandLine"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'*---------------------------------------------------------------
'*
'* ClassName:      clsCommandLine
'* FileName:       CMDLINE.CLS
'* Date:           July 1998
'* Author:         Ian M. Weatherburn
'* Company:        Mindkey Software Solutions (Pty) Ltd.
'* Copyright:      Copyright (C) 1998 by Mindkey Software Solutions
'*                 All Rights Reserved
'* Description:    Parse a command-line and return a list
'*                 of it's components
'*---------------------------------------------------------------

Option Explicit

Private collArgs As Collection

Public Property Get Count() As Long
  Count = collArgs.Count
End Property

Public Property Get Item(lngIndex As Long) As String
  Item = collArgs.Item(lngIndex)
End Property

Public Function Parse(strCommandLine As String)
  Dim intStartPos As Integer
  Dim intPos, intLastPos As Integer
  
  If UCase(Right$(strCommandLine, 3)) = "XML" Then
    basMain.blnXMLorNormal = True
  Else
    basMain.blnXMLorNormal = False
  End If
  intStartPos = 1
  intPos = -1
  
  Do
    intPos = InStr(intStartPos, strCommandLine, " ")
    
    ' Handle the end of the command-line (the last argument)
    If intPos = 0 Then
      collArgs.Add Mid(strCommandLine, intStartPos)
    Else
      collArgs.Add Mid(strCommandLine, intStartPos, intPos - intStartPos)
      intStartPos = intPos + 1
    End If
  Loop While intPos <> 0
  
End Function

Private Sub Class_initialize()

  ' Initialise collection of files
  Set collArgs = New Collection
End Sub

Private Sub Class_Terminate()

  ' Release collection
  Set collArgs = Nothing
End Sub


